package org.gap.domain;

import java.io.Serializable;

import java.util.Calendar;

import javax.persistence.Id;

import javax.persistence.*;

/**
 */
public class AdressesTiersPK implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 */
	public AdressesTiersPK() {
	}

	/**
	 */

	@Column(name = "ADT_ADRESSE", nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	public Integer adtAdresse;
	/**
	 */

	@Column(name = "ADT_TIERS", nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	public Integer adtTiers;
	/**
	 */

	@Column(name = "ADT_TYPE_ADRESSE", length = 10, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	public String adtTypeAdresse;
	/**
	 */

	@Column(name = "ADT_ETAT_AFFECTATION", length = 1, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	public String adtEtatAffectation;
	/**
	 */
	@Temporal(TemporalType.DATE)
	@Column(name = "ADT_FIN_AFFECTATION", nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	public Calendar adtFinAffectation;

	/**
	 */
	public void setAdtAdresse(Integer adtAdresse) {
		this.adtAdresse = adtAdresse;
	}

	/**
	 */
	public Integer getAdtAdresse() {
		return this.adtAdresse;
	}

	/**
	 */
	public void setAdtTiers(Integer adtTiers) {
		this.adtTiers = adtTiers;
	}

	/**
	 */
	public Integer getAdtTiers() {
		return this.adtTiers;
	}

	/**
	 */
	public void setAdtTypeAdresse(String adtTypeAdresse) {
		this.adtTypeAdresse = adtTypeAdresse;
	}

	/**
	 */
	public String getAdtTypeAdresse() {
		return this.adtTypeAdresse;
	}

	/**
	 */
	public void setAdtEtatAffectation(String adtEtatAffectation) {
		this.adtEtatAffectation = adtEtatAffectation;
	}

	/**
	 */
	public String getAdtEtatAffectation() {
		return this.adtEtatAffectation;
	}

	/**
	 */
	public void setAdtFinAffectation(Calendar adtFinAffectation) {
		this.adtFinAffectation = adtFinAffectation;
	}

	/**
	 */
	public Calendar getAdtFinAffectation() {
		return this.adtFinAffectation;
	}

	/**
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + ((adtAdresse == null) ? 0 : adtAdresse.hashCode()));
		result = (int) (prime * result + ((adtTiers == null) ? 0 : adtTiers.hashCode()));
		result = (int) (prime * result + ((adtTypeAdresse == null) ? 0 : adtTypeAdresse.hashCode()));
		result = (int) (prime * result + ((adtEtatAffectation == null) ? 0 : adtEtatAffectation.hashCode()));
		result = (int) (prime * result + ((adtFinAffectation == null) ? 0 : adtFinAffectation.hashCode()));
		return result;
	}

	/**
	 */
	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof AdressesTiersPK))
			return false;
		AdressesTiersPK equalCheck = (AdressesTiersPK) obj;
		if ((adtAdresse == null && equalCheck.adtAdresse != null) || (adtAdresse != null && equalCheck.adtAdresse == null))
			return false;
		if (adtAdresse != null && !adtAdresse.equals(equalCheck.adtAdresse))
			return false;
		if ((adtTiers == null && equalCheck.adtTiers != null) || (adtTiers != null && equalCheck.adtTiers == null))
			return false;
		if (adtTiers != null && !adtTiers.equals(equalCheck.adtTiers))
			return false;
		if ((adtTypeAdresse == null && equalCheck.adtTypeAdresse != null) || (adtTypeAdresse != null && equalCheck.adtTypeAdresse == null))
			return false;
		if (adtTypeAdresse != null && !adtTypeAdresse.equals(equalCheck.adtTypeAdresse))
			return false;
		if ((adtEtatAffectation == null && equalCheck.adtEtatAffectation != null) || (adtEtatAffectation != null && equalCheck.adtEtatAffectation == null))
			return false;
		if (adtEtatAffectation != null && !adtEtatAffectation.equals(equalCheck.adtEtatAffectation))
			return false;
		if ((adtFinAffectation == null && equalCheck.adtFinAffectation != null) || (adtFinAffectation != null && equalCheck.adtFinAffectation == null))
			return false;
		if (adtFinAffectation != null && !adtFinAffectation.equals(equalCheck.adtFinAffectation))
			return false;
		return true;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder("AdressesTiersPK");
		sb.append(" adtAdresse: ").append(getAdtAdresse());
		sb.append(" adtTiers: ").append(getAdtTiers());
		sb.append(" adtTypeAdresse: ").append(getAdtTypeAdresse());
		sb.append(" adtEtatAffectation: ").append(getAdtEtatAffectation());
		sb.append(" adtFinAffectation: ").append(getAdtFinAffectation());
		return sb.toString();
	}
}
